package map;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class MapDemo3 {
    public static void main(String[] args) {
        Map<String,Integer>map = new HashMap<>();
        map.put("语文",60);
        map.put("数学",100);
        map.put("英语",65);
        map.put("物理",99);
        map.put("化学",98);
        System.out.println(map.keySet());
        Set<String> keyset = map.keySet();
        for (String key : keyset){
            System.out.println("key:"+key);
        }
        System.out.println(map.values());
        Collection<Integer>values = map.values();
        for (Integer value : values){
            System.out.println("value:"+value);
        }
        System.out.println(map.entrySet());
        Set<Map.Entry<String,Integer>>entrySet = map.entrySet();
        for (Map.Entry<String,Integer> e : entrySet){
            String key = e.getKey();
            Integer value = e.getValue();
            System.out.println("kye:"+key+"value:"+value);
        }
    }
}
